﻿using System.Configuration;

namespace Altairis.Nemesis.Gallery.Configuration {

    public class GallerySection : ConfigurationSection {

        public static GallerySection GetCurrentOrDefault() {
            return (ConfigurationManager.GetSection("altairis.nemesis.gallery") as GallerySection) ?? new GallerySection();
        }

        [ConfigurationProperty("sizes", IsRequired = true, IsDefaultCollection = true)]
        [ConfigurationCollection(typeof(SizeElementCollection))]
        public SizeElementCollection Sizes {
            get { return (SizeElementCollection)this["sizes"]; }
            set { this["sizes"] = value; }
        }

        [ConfigurationProperty("templates", IsRequired = false)]
        public TemplatesElement Templates {
            get { return (TemplatesElement)this["templates"]; }
            set { this["templates"] = value; }
        }

        [ConfigurationProperty("personalization", IsRequired = false)]
        public PersonalizationElement Personalization {
            get { return (PersonalizationElement)this["personalization"]; }
            set { this["personalization"] = value; }
        }

    }

}